From: Ian Jackson Date: Thu, 17 May 2012 13:45:41 +0000 (+0100) Subject: libxl: Do not use-after-free on ao progress reporting X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~8439 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=a836d6543e0b417e147f01950e4fccfdc87fc449;p=xen.git libxl: Do not use-after-free on ao progress reporting We need to call libxl__free_all after egc_run_callbacks since some of the callbacks might be ao progress reports allocated from the egc's gc. Fixes a segfault in egc_run_callbacks. Signed-off-by: Ian Jackson Acked-by: Ian Campbell Committed-by: Ian Campbell --- diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index 350e846aa4..7fbd5c3702 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -988,9 +988,9 @@ static void egc_run_callbacks(libxl__egc *egc) void libxl__egc_cleanup(libxl__egc *egc) { EGC_GC; - libxl__free_all(gc); - egc_run_callbacks(egc); + + libxl__free_all(gc); } /*